#ifndef VOICEREC_H
#define VOICEREC_H

#include <QAudioInput>
#include <QBuffer>
#include <QObject>
#include "wxapi.h"

class voiceRec : public QObject
{
    Q_OBJECT
public:
    explicit voiceRec(QObject *parent = nullptr);
    ~voiceRec();

    void setupAudioFormat();
    void startRecording();
    void stopRecording();

private:
    QNetworkAccessManager *manager;
    QAudioInput *audioInput;
    QBuffer audioBuffer;
    QAudioFormat audioFormat;


signals:
    void send_audioData(QByteArray);

};

#endif // VOICEREC_H
